package org.example.controller;

import org.example.service.OpenFeignClient;
import org.example.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @Autowired
    private TestService testService;
    @Autowired
    private OpenFeignClient openFeignClient;

    @GetMapping("/test")
    public String test() {
        return openFeignClient.testOpenFeign();
    }


    @GetMapping("/read")
    public String read() {
        testService.serviceResource();
        return "read_db";
    }
    @GetMapping("/write")
    public String write() {
        testService.serviceResource();
        return "write_db";
    }
}
